<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>查成绩</title></head>
<body>
  <h3>输入姓名查成绩</h3>
  <input id="name" placeholder="请输入姓名">
  <button onclick="check()">查询</button>
  <p id="result"></p>

  <script>
    const scores = {
      "张三": 95,
      "李四": 88,
      "王五": 76
    };

    function check() {
      let name = document.getElementById('name').value.trim();
      let result = scores[name] !== undefined ? `成绩：${scores[name]}` : "查无此人";
      document.getElementById('result').innerText = result;
    }
  </script>
</body>
</html>
